//modified golden to suit needs
double mygolden(const double ax, const double bx, const double cx,const double tol, double &xmin,void * params,double f(const double,void *))
{
// This function is a modified version of the golden function in Numerical Recipe. We are not allowed to distribute this file. The original version of this function can be found at https://numerical.recipes/. If necessary, they can easily be replaced by equivalent functions from the GNU Scientific Library (GSL) that can be found at https://www.gnu.org/software/gsl/. Our modified version of this function can be obtained upon demand.
}
